home *** CD-ROM | disk | FTP | other *** search
- // Author : Daniel Dickman(NetSupport Ltd)
- // File name : DrvSize.scp
- // Date created : 17/08/00
- // Modified : Andy Earp 10/09/00
- // Description :
- // This script will perform a browse for all available clients on the network and connect to each Client in turn. It will
- // then report back information regarding the amount of available space on each drive on the Client machine
- // including mapped network drives. This script can be used to find out if there is enough space on the required
- // drive on the Client machine to install a application. It is possible to define within the script the size of the
- // application so the script will report back if there is enough space or not on the drive to install the application.
-
- // **Note: If there is no Floppy disk in the machine a error 21 reading drive error will occur
-
- Print "***************************************************************"
- Print " "
- Print " This script is firstly going to prompt the user to enter"
- Print " partial Client details for the lookup. Next the script"
- Print " will connect to each Client in turn and display "
- Print " the amount of free space found on each drive"
- Wait (7)
- Print " "
- Print " The script will check if there is more than"
- Print " 290Mb of free space available on each drive."
-
- Wait (8)
- Print " "
- Print " **Note: This script will not be able to display "
- Print " the correct drive size of mapped drives for "
- Print " NT\W2000 and will report that 0Mb of free space"
- Print " is available. To report the correct size enable"
- Print " the option to 'Impersonate the current user' in the "
- Print " Advanced Client configurator."
- Print " "
- Wait (8)
-
- SetTransport(T_TCPIP)
-
- // Declares each variable used within the script
- Dim ClientList
- Dim Client
- Dim Mask
- Dim Count
-
- Count = 0
-
- If input ("Please enter a Client prefix to restrict the number of Clients found or press ok to include all Clients : ", Mask) = false then
- Print " The script has been cancelled and will now stop!"
- Print " *********************************************************"
- Wait (4)
- Stop
- Else
- // Performs a browse for available Clients, you can enter partial or complete Client name details within the speech marks
- Lookup (Mask, ClientList)
-
- // performs the drive space check for each Client found in the lookup
- for each client in clientlist
-
- // Error checks the connection to the Client
- If Connect (Client) = FALSE then
- Print " Could not connect to the client!"
- Wait (4)
- else
- Print " Connected to client ", CurrentClient (), " okay"
- Wait(3)
-
- // Declares further variables used in this condition
- Dim driveletter
- Dim drivelst
- Dim drivepath
- Dim drivespace2
-
- // Creates a list of all available drives on the machine
- GetDriveList(">",drivelst)
-
- // Performs the below condition for each drive found in the drive list
- for each drive in drivelst
-
- report_size = 2 // Makes sure that the sizes returned are in Megabytes.
- ; print " Drive ", drive," is ", DriveSize (">"+ drive)," MB" //Reports the size of the drive
- print " "
- print " Drive ", drive," has ", DriveSpace(">"+ drive), " MB free" // reports the available space on the drive that is free
- drivepath = DriveSize(">"+drive)
- drivespace2 = DriveSpace(">"+drive)
-
- // Will state if the current drive is empty
- If drivepath == 0 and drivespace2 ==0 then
- print " Disk drive is empty "
- Print "**********************"
- wait (3)
- else
-
- // Will state if the current drive is full
- if drivepath<>0 and drivespace2 ==0 then
- print " Drive is full "
- Print " ************ "
- Wait (3)
- else
-
- // This is were you can change the size of the amount of free space you require, currently set at 290MB
- if drivespace2 <=290 then
- print " Not enough room to install application"
- Print " ********************************************"
- wait (3)
- else
- Print " There is still room to install."
- Print " *******************************"
- Wait (3)
- endif
- endif
- endif
- next
- // Disconnects from the Client machines
- Print " "
- Print " You have disconnected from ", currentClient(),""
- Disconnect(Client)
- Wait(5)
- Count = Count + 1
- endif
- next
- If Count = 0 then
- Print "There were no available Clients found on the network"
- Else
- Print "The number of Clients found was ", Count
- Endif
- Print "************************************************************"
- Print " "
- Print "To edit or view the contents of this"
- Print "script right mouse button click"
- Print "on the Script icon and select Edit"
-
- endif
- //Copyright ⌐ 2000